<!DOCTYPE html>
<html>
<head>
    <title>String Type Location Methods Example 2</title>
    <script type="text/javascript">
    
        var stringValue = "Lorem ipsum dolor sit amet, consectetur adipisicing elit";
        var positions = new Array();
        var pos = stringValue.indexOf("e");
        
        while(pos > -1){
            positions.push(pos);
            pos = stringValue.indexOf("e", pos + 1);
        }
            
        alert(positions);    //"3,24,32,35,52"
    </script>
</head>
<body>

</body>
</html>